home *** CD-ROM | disk | FTP | other *** search
/ Chip: 2001 Haziran / CHIP Haziran2001.iso / prog / haziran / 20 / setup.exe / {app} / plugins / XQ Script Files 1.xpl < prev    next >
Encoding:
XSetup plugin  |  2001-03-28  |  2.8 KB  |  107 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 5.0"
  2. "TYPE"="6"
  3. "COUNT"="3"
  4. "UIPATH"="System\Security\Common"
  5. "NAME"="Script Files"
  6. "LANGUAGE"="VBScript"
  7. "VERSION"="1.03"
  8. "TEXT 1"="Open *.VBS/*.VBE with Notepad when opened"
  9. "TEXT 2"="Open *.JS/*.JSE with Notepad when opened"
  10. "TEXT 3"="Open *.WSH/*.WSF with Notepad when opened"
  11. "DESCRIPTION 1"="Script files are powerful to automate common tasks but they are also a security problem. Some mad people use script files to create viruses (e.g. the "I LOVE YOU" virus in May 2000) so it's better to have a look at the files before executing them."
  12. "DESCRIPTION 2"="If the checkbox is activated, a double click on a script file will open Notepad instead of executing the script. This way, you can review the file before executing it. "
  13. "DESCRIPTION 3"="After this review, just select the file, right click and select "Open" from the appearing menu to execute the script finally."
  14. "AUTHOR"="Xteq Systems"
  15. "CONTACTURL"="http://www.xteq.com"
  16. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  17. "COMMENT 1"=" "
  18.  
  19.  
  20.  
  21.  
  22.  
  23. sDefault_a="HKCR\"
  24. sDefault_b="\Shell\@"
  25. sDefault_Value="Edit"
  26. sDefault_Edit_a="HKCR\"
  27. sDefault_Edit_b="\Shell\Edit\Command\@"
  28. sDefault_Edit_Cmd="Notepad.exe %1"
  29.  
  30. sP1a="HKCR\.VBS\@"
  31. sP1b="HKCR\.VBE\@"
  32.  
  33. sP2a="HKCR\.JS\@"
  34. sP2b="HKCR\.JSE\@"
  35.  
  36. sP3a="HKCR\.WSH\@"
  37. sP3b="HKCR\.WSF\@"
  38.  
  39. Sub Plugin_Initialize 
  40.  b1=ReadStatus(sP1a)
  41.  b2=ReadStatus(sP1b)
  42.  if b1=true and b2=true then SetUIElement 1,true
  43.  
  44.  b1=ReadStatus(sP2a)
  45.  b2=ReadStatus(sP2b)
  46.  if b1=true and b2=true then SetUIElement 2,true
  47.  
  48.  b1=ReadStatus(sP3a)
  49.  b2=ReadStatus(sP3b)
  50.  if b1=true and b2=true then SetUIElement 3,true
  51. End Sub
  52.  
  53. Sub Plugin_CheckData(ElementIndex)
  54. End Sub
  55.  
  56. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  57.  Call WriteChanges(sP1a,GetUIElement(1))
  58.  Call WriteChanges(sP1b,GetUIElement(1))
  59.  
  60.  Call WriteChanges(sP2a,GetUIElement(2))
  61.  Call WriteChanges(sP2b,GetUIElement(2))
  62.  
  63.  Call WriteChanges(sP3a,GetUIElement(3))
  64.  Call WriteChanges(sP3b,GetUIElement(3))
  65. End Sub
  66.  
  67. Sub Plugin_Terminate 
  68. End Sub
  69.  
  70.  
  71. Function ReadStatus(key)
  72.  s=RegReadValue(key)
  73.  'Debugmsg s
  74.  s=sDefault_a & s & sDefault_b
  75.  s=RegReadValue(s)
  76.  if s=sDefault_Value then
  77.     ReadStatus=true
  78.  else
  79.     ReadStatus=false
  80.  end if
  81. End Function
  82.  
  83. Sub WriteChanges(key,activated)
  84.  sPathFirst=RegReadValue(key)
  85.  'Debugmsg s
  86.  sPath=sDefault_a & sPathFirst & sDefault_b
  87.  v=RegReadValue(sPath)
  88.  
  89.  if activated=false then 'EXECUTE!
  90.     if IsEmpty(v)=false then
  91.        RegDeleteValue sPath
  92.     end if
  93.  else 'DEACTIVATE
  94.     RegWriteValue sPath,sDefault_Value,1
  95.  
  96.     'check if "EDIT" exists
  97.     sPath=sDefault_Edit_a & sPathFirst & sDefault_Edit_b
  98.     v=RegReadValue(sPath)
  99.     if IsEmpty(v) then
  100.        RegWriteValue sPath,sDefault_Edit_Cmd,1
  101.     end if
  102.  end if
  103.  
  104. End Sub
  105.  
  106.  
  107.